package com.dongdong.bookstore.module.ums.service;

import com.dongdong.bookstore.module.ums.model.Menu;
import com.dongdong.bookstore.module.ums.model.Resource;
import com.dongdong.bookstore.module.ums.model.Role;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dongdong.bookstore.module.ums.viewmodel.RoleParam;
import com.dongdong.bookstore.security.components.DynamicSecurityMetadataSource;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 * 角色表 服务类
 * </p>
 *
 * @author chiangkai
 * @since 2021-10-20
 */
public interface RoleService extends IService<Role> {

    List<Role> getLoleListByAdminId(Long adminId);


    /**
     * 通过管理员名称修改管理员角色
     */
    void updateRole(Long adminId, List<Long> roleIds);

    void create(RoleParam roleParam);

    void update(Long id, RoleParam roleParam);

    boolean delete(List<Long> ids);

    boolean updateStateById(Long id, Integer status);

    List<Menu> menuListByRoleId(Long roleId);

    List<Resource> resourceListByRoleId(Long roleId);

    void allocateMenu(Long roleId, List<Long> menuIds);

    void allocateResource(Long roleId, List<Long> resourceIds);
}
